<?php

namespace common\models\base;

use Yii;

/**
 * This is the model class for table "{{%jzg_place9_order}}".
 *
 * @property int $id
 * @property string $order_num
 * @property string $vin
 * @property string $province_id
 * @property string $city_id
 * @property int $product_type
 * @property string $image_list
 * @property string $order_name
 * @property string $order_phone
 * @property int $time
 * @property int $status
 * @property int $created_at
 * @property int $updated_at
 * @property string $resp_status
 * @property string $resp_data
 * @property string $jzg_order_num
 * @property string $assessment_price_b2c
 * @property string $assessment_price_c2b
 * @property string $max_assessment_price_b2c
 * @property string $resp1_data
 * @property string $resp2_data
 *
 * @property JzgBack5[] $jzgBack5s
 */
class JzgPlace9Order extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%jzg_place9_order}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['order_num', 'vin', 'province_id', 'city_id', 'image_list', 'order_name', 'order_phone', 'time', 'created_at', 'updated_at', 'resp_status', 'resp_data'], 'required'],
            [['product_type', 'time', 'status', 'created_at', 'updated_at'], 'integer'],
            [['image_list', 'resp_data', 'resp1_data', 'resp2_data'], 'string'],
            [['order_num', 'jzg_order_num'], 'string', 'max' => 150],
            [['vin'], 'string', 'max' => 17],
            [['province_id', 'city_id', 'resp_status', 'assessment_price_b2c', 'assessment_price_c2b', 'max_assessment_price_b2c'], 'string', 'max' => 20],
            [['order_name'], 'string', 'max' => 50],
            [['order_phone'], 'string', 'max' => 11],
            [['order_num'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'order_num' => Yii::t('app', 'Order Num'),
            'vin' => Yii::t('app', 'Vin'),
            'province_id' => Yii::t('app', 'Province ID'),
            'city_id' => Yii::t('app', 'City ID'),
            'product_type' => Yii::t('app', 'Product Type'),
            'image_list' => Yii::t('app', 'Image List'),
            'order_name' => Yii::t('app', 'Order Name'),
            'order_phone' => Yii::t('app', 'Order Phone'),
            'time' => Yii::t('app', 'Time'),
            'status' => Yii::t('app', 'Status'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'resp_status' => Yii::t('app', 'Resp Status'),
            'resp_data' => Yii::t('app', 'Resp Data'),
            'jzg_order_num' => Yii::t('app', 'Jzg Order Num'),
            'assessment_price_b2c' => Yii::t('app', 'Assessment Price B2c'),
            'assessment_price_c2b' => Yii::t('app', 'Assessment Price C2b'),
            'max_assessment_price_b2c' => Yii::t('app', 'Max Assessment Price B2c'),
            'resp1_data' => Yii::t('app', 'Resp1 Data'),
            'resp2_data' => Yii::t('app', 'Resp2 Data'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getJzgBack5s()
    {
        return $this->hasMany(JzgBack5::className(), ['vin' => 'vin']);
    }
}
